<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script>
        /*变量赋值*/
        var name = prompt('请输入姓名');
        alert(name);
        console.log(name);
        /*变量替换*/
        var a1='第一个';
        var a2='第二个';
        var temp;
        temp=a1;
        a1=a2;
        a2=temp;
        alert(a1);

    </script>
</head>
<body>

</body>
</html>